home *** CD-ROM | disk | FTP | other *** search
/ Apple Macintosh CD: Power Macintosh 4400 Series / 691-1334-A,B,Power Macintosh 4400 Series. Apple Macintosh CD. (CD).toast / CD Extras / ARA Client Install / Modem CCLs / Motorola Power⁄Lifestyle 28.8 / Motorola Power_Lifestyle 28.8 next >
Text File  |  1996-05-24  |  9KB  |  480 lines

  1. !  Motorola Lifestyle 288
  2. !    Author:    Kris Kreutzman
  3. !
  4. !    Copyright:    © 1991-1996 Apple Computer, Inc.    All Rights Reserved.
  5. !
  6. !    revision history:
  7. !        v2.1    as shipped with the ARA 2.1
  8. !
  9. !  'mlts' resource info for this modem:
  10. !    byte 1 == 01 -> modem HAS built-in error correction protocols
  11. !    byte 2 == 01 -> modem HAS built-in data compression protocols
  12. !    byte 3 == 81 -> max number of chars in varstr 7
  13. !    byte 4 == 81 -> max number of chars in varstr 8
  14. !    byte 5 == 81 -> max number of chars in varstr 9
  15. !    
  16. @ORIGINATE
  17. @ANSWER
  18. !
  19. ! ---- Initial modem setup ----
  20. !
  21. ! Set serial port speed depending upon the compression flag
  22. !    A higher rate with compression on to handle expanded data from the modem
  23. !    A lower rate closer to the DCE when compression is off
  24. ifstr 5 1 "0"
  25. serreset 57600, 0, 8, 1
  26. jump 2
  27. !
  28. @LABEL 1
  29. serreset 38400, 0, 8, 1
  30. !
  31. @LABEL 2
  32. hsreset 0 0 0 0 0 0
  33. settries 0
  34. !
  35. ! Get the modem's attention
  36. !
  37. matchclr
  38. matchstr 1 3 "OK\13\10"
  39. write "AT\13"
  40. matchread 30
  41. !
  42. @LABEL 3
  43. !
  44. ! Setup the modem for the following:
  45. !   Reset to factory settings
  46. !   Standard compression/reliablity
  47. !   Lock serial port speed
  48. !   Serial port hardware handshaking, turn off software handshaking
  49. !   Verbose responces and compression/protocol results
  50. !   CONNECT returns DCE speed
  51. !   Turn off answering
  52. !   Reset or return to command mode on DTR toggle (optional)
  53. !
  54. matchclr
  55. matchstr 1 4   "OK\13\10"
  56. matchstr 2 101 "ERROR\13\10"
  57. write "AT&FE0&D2\\V3\\Q2\\K0S7=120S0=0\13"
  58. matchread 30
  59. inctries
  60. iftries 3 101
  61. !
  62. ! Reset the Modem on setup failure
  63. !
  64. DTRClear
  65. pause 5
  66. DTRSet
  67. flush
  68. jump 3
  69. !
  70. !
  71. @LABEL 4
  72. ! Varstring 4 , reliable link protocol:
  73. !    = 0, handled by computer (ARAP)
  74. !    = 1, handled by modem (PPP)
  75. !    = 2, MNP10 protocol (Cellular protocol, no longer supported)
  76. ifstr 4 5 "1"
  77. ifstr 4 5 "2"
  78. !
  79. ! Varstring 4 == 0, turn off reliable link protocol in modem (ARAP)
  80. matchclr
  81. matchstr 1 9 "OK\13\10"
  82. write "AT\\N\13"
  83. matchread 30
  84. jump 101
  85. !
  86. !
  87. @LABEL 5
  88. ! Varstring 5, compression protocol:
  89. !    = 0, handled by computer 
  90. !    = 1, handled by modem
  91. ifstr 5 9 "1"
  92. !
  93. ! Varstring 5 == 0, turn off compression protocol in modem.
  94. matchclr
  95. matchstr 1 9 "OK\13\10"
  96. write "AT%C\13"
  97. matchread 30
  98. jump 101
  99. !
  100. !
  101. @LABEL 9
  102. ! Varstring 2, modem speaker:
  103. !    = 0, speaker off
  104. !    = 1, speaker on
  105. ifstr 2 13 "1"
  106. pause 5
  107. matchclr
  108. matchstr 1 13 "OK\13\10"
  109. write "ATM0\13"
  110. matchread 30
  111. jump 101
  112. !
  113. ! Modem ready, wait for a call or originate a call
  114. !
  115. @LABEL 13
  116. ifANSWER 32
  117. !
  118. !
  119. ! ---- Originating a call ----
  120. !
  121. ! Varstring 6, dialing mode:
  122. !    = 0, normal dialing
  123. !    = 1, blind dialing
  124. !    = 2, manual dialing
  125. !    otherwise dial as ARA version 1.0
  126. ifstr 6 19 "0"
  127. ifstr 6 17 "1"
  128. ifstr 6 15 "2"
  129. !
  130. ! Dialing for ARA version 1.0
  131. note "Dialing ^1" 3
  132. write "ATD^3^1\13
  133. jump 32
  134. !
  135. @LABEL 15
  136. ! Display ASK dialog with message.  Goto label 107 if dialog canceled.
  137. ASK 2 "Pick up the phone & dial ^1.  Hit OK when the phone rings, then hangup." 107
  138. note "Manual dialing initiated" 3
  139. ! X1 to ignore dialtone & busy, D to dial, \^ generates data tone
  140. write "ATX1D\13"
  141. jump 32
  142. !
  143. @LABEL 17
  144. note "Dialing without tone" 3
  145. matchclr
  146. matchstr 1 19 "OK\13\10"
  147. ! X1 to ignore dialtone & busy
  148. write "ATX1\13"
  149. matchread 30
  150. jump 101
  151. !
  152. !
  153. !
  154. @LABEL 19
  155. ! Display the full dialstring contained in Varstring 1
  156. note "Dialing ^1" 3
  157. !
  158. ! Varstrings 7, 8 and 9, contain dialstring fragments
  159. !    Long phone numbers may need to be split into smaller groups
  160. !    for the modem to use
  161. !
  162. ! Varstring 3:  "p" for pulse & "t" for tone dialing
  163. ! Varstring 8 == blank (dialstring in varstring 7)
  164. ! Varstring 9 == blank (dialstring in varstrings 7 & 8)
  165. ! Otherwise (dialstring in varstrings 7, 8 & 9)
  166. ! \^ is added to the dialstring to force the modem to generate a data tone
  167. ifstr 8 27 " "
  168. ifstr 9 24 " "
  169. !
  170. !  Write dialstring in varstrings 7, 8 & 9
  171. matchclr
  172. matchstr 1 21 "OK\13\10"
  173. write "ATD^3^7;\13"
  174. matchread 400
  175. jump 101
  176.  
  177. @LABEL 21
  178. matchclr
  179. matchstr 1 22 "OK\13\10"
  180. write "ATD^3^8;\13"
  181. matchread 400
  182. jump 101
  183.  
  184. @LABEL 22
  185. write "ATD^3^9\13"
  186. jump 32
  187. !
  188. !
  189. @LABEL 24
  190. !  Write dialstring in varstrings 7 & 8
  191. matchclr
  192. matchstr 1 25 "OK\13\10"
  193. write "ATD^3^7;\13"
  194. matchread 400
  195. jump 101
  196.  
  197. @LABEL 25
  198. write "ATD^3^8\13"
  199. jump 32
  200. !
  201. @LABEL 27
  202. !  Write dialstring in varstring 7
  203. write "ATD^3^7\13"
  204. !
  205. !
  206. !    ---- Connection responce ----
  207. !
  208. ! The following section will parse modem responces of two types:
  209. !   1) PROTOCOL: xxx, COMPRESSION: xxx, CONNECT xxx
  210. !   2) CONNECT xxx/ARQ/V42
  211. !
  212. @LABEL 32
  213. matchclr
  214. matchstr  1 81  "RING\13\10"
  215. matchstr  2 102 "NO DIALTONE\13\10"
  216. matchstr  3 103 "NO CARRIER"
  217. matchstr  4 103 "ERROR\13\10"
  218. matchstr  5 104 "BUSY\13\10"
  219. matchstr  6 105 "NO ANSWER\13\10"
  220. matchstr  7 33  "CONNECT "
  221. matchstr  8 32  "CARRIER"
  222. matchstr  9 40  "CONNECT\13\10"
  223. matchstr 10 62  "PROTOCOL: LAP"
  224. matchstr 11 62  "PROTOCOL: MNP"
  225. matchstr 12 62  "PROTOCOL: ALT"
  226. matchstr 13 67  "COMPRESSION: V"
  227. matchstr 14 67  "COMPRESSION: MNP5"
  228. matchstr 15 67  "COMPRESSION: CLASS"
  229. matchread 700
  230. ifANSWER 32
  231. jump 105
  232. !
  233. !  Parse the speed of connect result codes
  234. !  2400 and 4800 have two entries each
  235. !  to distinguish them from 24000 and 48000
  236. !
  237. @LABEL 33
  238. matchclr
  239. matchstr  1 40 "2400\13"
  240. matchstr  2 40 "2400/"
  241. matchstr  3 41 "4800\13"
  242. matchstr  4 41 "4800/"
  243. matchstr  5 42 "7200"
  244. matchstr  6 43 "9600"
  245. matchstr  7 44 "12000"
  246. matchstr  8 45 "14400"
  247. matchstr  9 46 "16800"
  248. matchstr 10 47 "19200"
  249. matchstr 11 48 "21600"
  250. matchstr 12 49 "24000"
  251. matchstr 13 50 "26400"
  252. matchstr 14 51 "28800"
  253. matchread 30
  254. jump 59
  255. !
  256. ! -- Connection rates --
  257. ! CommunicatingAt informs ARA of the raw modem to modem
  258. ! connection speed.
  259. !
  260. @LABEL 40
  261. note "Communicating at 2400 bps." 2
  262. CommunicatingAt 2400
  263. jump 60
  264. !
  265. @LABEL 41
  266. note "Communicating at 4800 bps." 2
  267. CommunicatingAt 4800
  268. jump 60
  269. !
  270. @LABEL 42
  271. note "Communicating at 7200 bps." 2
  272. CommunicatingAt 7200
  273. jump 60
  274. !
  275. @LABEL 43
  276. note "Communicating at 9600 bps." 2
  277. CommunicatingAt 9600
  278. jump 60
  279. !
  280. @LABEL 44
  281. note "Communicating at 12400 bps." 2
  282. CommunicatingAt 12400
  283. jump 60
  284. !
  285. @LABEL 45
  286. note "Communicating at 14400 bps." 2
  287. CommunicatingAt 14400
  288. jump 60
  289. !
  290. @LABEL 46
  291. note "Communicating at 16800 bps." 2
  292. CommunicatingAt 16800
  293. jump 60
  294. !
  295. @LABEL 47
  296. note "Communicating at 19200 bps." 2
  297. CommunicatingAt 19200
  298. jump 60
  299. !
  300. @LABEL 48
  301. note "Communicating at 21600 bps." 2
  302. CommunicatingAt 21600
  303. jump 60
  304. !
  305. @LABEL 49
  306. note "Communicating at 24000 bps." 2
  307. CommunicatingAt 24000
  308. jump 60
  309. !
  310. @LABEL 50
  311. note "Communicating at 26400 bps." 2
  312. CommunicatingAt 26400
  313. jump 60
  314. !
  315. @LABEL 51
  316. note "Communicating at 28800 bps." 2
  317. CommunicatingAt 28800
  318. jump 60
  319. !
  320. @LABEL 59
  321. note "Communicating at an unknown rate." 2
  322. jump 60
  323. !
  324. ! Look for reliablilty and compression results 
  325. ! at the end of the connect result.
  326. !
  327. @LABEL 60
  328. matchclr
  329. matchstr  1 63 "LAPM"
  330. matchstr  2 63 "REL"
  331. matchstr  3 63 "ARQ"
  332. matchstr  4 68 "COMP/"
  333. matchstr  5 68 "COMP\13"
  334. matchstr  6 63 "V42/"
  335. matchstr  7 63 "V42\13"
  336. matchstr  8 68 "V42BIS"
  337. matchstr  9 68 "V42bis"
  338. matchstr 10 63 "MNP\13"
  339. matchstr 11 68 "MNP5"
  340. matchstr 12 70 "\10"
  341. matchread 30
  342. jump 70
  343.  
  344. ! -- Modem error correction link negotiation --
  345. ! Userhook 2 informs ARA that a modem-to-modem error
  346. ! correcting protocol has been negotiated
  347. !
  348. !
  349. @LABEL 62
  350. note "Modem Reliable Link Established." 2
  351. userhook 2
  352. jump 32
  353. !
  354. @LABEL 63
  355. note "Modem Reliable Link Established." 2
  356. userhook 2
  357. jump 60
  358. !
  359. ! -- Compression negotiation --
  360. ! Userhook 3 informs ARA that a modem-to-modem compression
  361. ! protocol has been negotiated
  362. !
  363. @LABEL 67
  364. note "Modem Compression Established." 2
  365. userhook 3
  366. jump 32
  367. !
  368. @LABEL 68
  369. note "Modem Compression Established." 2
  370. userhook 3
  371. jump 60
  372. !
  373. !
  374. ! -- Normal exit after "CONNECT" --
  375. !
  376. !  This modem has been setup to do CTS handshaking,
  377. !  and we assume that a CTS handshaking cable is being used.
  378. !
  379. @LABEL 70
  380. ! Turn on CTS handshaking.
  381. HSReset 0 1 0 0 0 0
  382. !
  383. ifANSWER 71
  384. pause 30
  385. @LABEL 71
  386. exit 0
  387. !
  388. !
  389. ! ---- Answer calls ----
  390. !
  391. !    A RING result from the modem and in ANSWERING mode
  392. !    claims the serial port and answering the phone
  393. !
  394. @LABEL 81
  395. ifORIGINATE 32
  396. userhook 1
  397. note "Answering phone..." 2
  398. write "ATA\13"
  399. jump 32
  400. !
  401. !
  402. ! ---- Hang up and reset modem ----
  403. !
  404. @HANGUP
  405. @LABEL 90
  406. settries 0
  407. HSReset 0 0 0 0 0 0
  408. !
  409. @LABEL 92
  410. !  Escape from data to command mode
  411. matchclr
  412. matchstr 1 96 "OK\13\10"
  413. write "+++"
  414. matchread 20
  415. !
  416. @LABEL 94
  417. ! Force a hangup
  418. matchclr
  419. matchstr 1 98 "NO CARRIER\13\10"
  420. matchstr 2 98 "OK\13\10"
  421. matchstr 3 98 "ERROR\13\10"
  422. matchstr 4 98 "0\13\10"
  423. write "ATH\13"
  424. matchread 30
  425. ! Try to get control of the modem by toggling DTR
  426. DTRClear
  427. pause 5
  428. DTRSet
  429. flush
  430. !
  431. ! Try the hangup sequence three times otherwise declare and error
  432. inctries
  433. iftries 3 101
  434. jump 92
  435. !
  436. @LABEL 96
  437. ! Pause between data and command mode
  438. pause 50
  439. jump 94
  440. !
  441. !
  442. @LABEL 98
  443. ! Recall the factory settings
  444. pause 15
  445. matchclr
  446. matchstr 1 99 "OK\13\10"
  447. write "AT&F\13"
  448. matchread 30
  449. jump 101
  450. !
  451. @LABEL 99
  452. exit 0
  453. !
  454. ! ---- Error messages -----
  455. !
  456. ! Modem Not Responding
  457. @LABEL 101
  458. exit -6019
  459. !
  460. ! No Dial Tone
  461. @LABEL 102
  462. exit -6020
  463. !
  464. ! No Carrier or Error
  465. @LABEL 103
  466. exit -6021
  467. !
  468. ! Busy
  469. @LABEL 104
  470. exit -6022
  471. !
  472. ! No Answer
  473. @LABEL 105
  474. exit -6023
  475. !
  476. ! User Cancellation
  477. @LABEL 107
  478. exit -6008